﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using ServicesComponent.Repositories.Core;
using Business_Objects;
using Data_Objects;
namespace ServicesComponent.Repositories
{
    ///// <summary>
    ///// ThanhPhanThucPham Repository. Good example of CRUD operations.
    ///// </summary>
    public class ThanhPhanThucPhamRepository : IThanhPhanThucPhamRepository
    {
        private static readonly IThanhPhanThucPhamDao _thanhPhanThucPham = DataAccess.ThanhPhanThucPhamDao;
        public List<ThanhPhanThucPham> GetList()
        {
            return _thanhPhanThucPham.GetThanhPhanThucPham().ToList();
        }

        public ThanhPhanThucPham Get(string id)
        {
            return _thanhPhanThucPham.GetThanhPhanThucPhamByID(id);
        }

        public void Insert(ThanhPhanThucPham t)
        {
            _thanhPhanThucPham.InsertThanhPhanThucPham(t);
        }

        public void Update(ThanhPhanThucPham t)
        {
            _thanhPhanThucPham.UpdateThanhPhanThucPham(t);
        }

        public void Delete(ThanhPhanThucPham t)
        {
            _thanhPhanThucPham.DeleteThanhPhanThucPham(t);
        }
    }
}